@layout("/common/_container.html"){
<style>
    .ui-state-default {
        height: 40px;
        background: #fff;
        border: 1px solid aliceblue;
        line-height: 40px;
        border-radius: 3px;
        margin-bottom: 2px;
        width: 50%;
    }

    .ui-state-default:hover {
        cursor: pointer;
    }

    .title {
        background: #000;
        color: #fff;
    }

    .sortLeft {
        padding-right: 20px;
    }

    .sortRight {
        padding-right: 20px;
    }

    .ui-sortable {
        /*float: right;*/
    }

    .right_box {
        width: 330px;
        height: 400px;
        position: absolute;
        top: 57px;
        left: 590px;
        border: 1px solid #1E84C6;
    }
</style>
<input type="hidden" id="sortMap" value="">
<input type="hidden" id="reservationsId" value="${reservationsId}">
<input type="hidden" id="customerId" value="${customerId}">
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal" id="addForm">
            <div class="row">
                <div class="col-sm-12 proSort">
                    <div style="width:100%;background-color: #F5F5F5;">
                        <#openRefundM  id="openRefundM" list="${payServiceInfoList}"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="btnBox">
        <button type="button" class="btn" onclick="returnMonrys()">提交</button>
        <button type="button" class="btn" id="cancel" onclick="addVisitedInfoDlg.close()">取消</button>
    </div>
</div>

<link rel="stylesheet" href="${ctxPath}/static/css/jqui/jquery-ui.min.css">
<script src="${ctxPath}/static/js/jquery-ui.min.js"></script>
<script src="${ctxPath}/static/modular/tcCenter/consultant/addVisited_info.js"></script>
<script>
    var getCount = 0;
    function returnMonrys() {
        getCount++;
        if (getCount == 1) {
            var input = document.getElementsByClassName('returnMonry');
            var refund = document.getElementsByClassName('refund');
            var parpams = "";
            var refunds = "";
            for (var f = 0; f < input.length; f++) {
                parpams += parseFloat(input[f].value) + "," + $(".returnMonry").eq(f).attr("id")
                    + "," + refund[f].value + "#";
            }
            /*  var arrears = document.getElementsByClassName('arrears');
        for (var i = 0; i < arrears.length; i++) {
            if (parseFloat(input[i].value) > parseFloat(arrears[i].innerHTML)) {
                alert("不能多于退款金额，请重新输入...！");
                return;
            }
        }*/

            $.ajax({
                url: Feng.ctxPath + "/consultant/returnMonrys",
                type: "post",
                data: {
                    "parpams": parpams
                },
                success: function (data) {
                    alert("退款成功!");
                    window.parent.parent.Customer.table.refresh();
                    $('#cancel', parent.document).click();
                    parent.layer.close(index);
                    window.parent.location.reload();
                },
                error: function (data) {
                    alert('退款失败!');
                }
            });
        }
    }
</script>

<style>
    .ui-state-default {
        height: 40px;
        background: #fff;
        border: 1px solid aliceblue;
        line-height: 40px;
        border-radius: 3px;
        margin-bottom: 2px;
        width: 50%;
    }

    .ui-state-default:hover {
        cursor: pointer;
    }

    .title {
        background: #000;
        color: #fff;
    }

    .sortLeft {
        padding-right: 20px;
    }

    .sortRight {
        padding-right: 20px;
    }

    .ui-sortable {
        /*float: right;*/
    }

    .right_box {
        width: 330px;
        height: 400px;
        position: absolute;
        top: 57px;
        left: 590px;
        border: 1px solid #1E84C6;
    }
    .btnBox button {
        background: #30add1;
        color: white;
        width: 96px;
    }
</style>
@}
